// 导入组件
import Vue from 'vue';
import Router from 'vue-router';

// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';
//主页
import Home from '@/views/system/Home';

//收件订单输入
import ReceivingOrders from '@/views/system/ReceivingOrders';
// 非收派订单输入
import AtypicalOrders from '@/views/system/AtypicalOrders';
// 引擎设置
import EngineSettings from '@/views/system/EngineSettings';
// 匹配结果
import MatchingResult from '@/views/system/MatchingResult';


// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false,
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [{
            path: '/system/Home',
            name: '主页',
            component: Home,
            meta: {
                requireAuth: true,
                keepAlive: true
            }
        },{
            path: '/system/ReceivingOrders',
            name: '收件订单输入',
            component: ReceivingOrders,
            meta: {
                requireAuth: true,
                keepAlive: true
            }
        }, {
            path: '/system/AtypicalOrders',
            name: '非收派订单输入',
            component: AtypicalOrders,
            meta: {
                requireAuth: true,
                keepAlive: true
            }
        }, {
            path: '/system/EngineSettings',
            name: '引擎配置',
            component: EngineSettings,
            meta: {
                requireAuth: true,
                keepAlive: true
            }
        },{
            path: '/system/MatchingResult',
            name: '匹配结果',
            component: MatchingResult,
            meta: {
                requireAuth: true,
                keepAlive: true
            }
        },{
            path: '/system/MapResult',
            name: '匹配结果',
            component: resolve => require(['@/views/system/MapResult'],resolve),
            meta: {
                requireAuth: true,
                keepAlive: true
            }
        }]
    }]
})